package com.dchh.android.suverynew.http;

import com.dchh.android.suverynew.common.ICommonModelListener;

import rx.Subscriber;

/**
 * Created by eric on 2016/7/13.
 */
public abstract class CommonSubscriber<T> extends Subscriber<T> {
    private ICommonModelListener mListener;

    public CommonSubscriber(ICommonModelListener listener) {
        this.mListener = listener;
    }

    @Override
    public void onCompleted() {
        this.mListener.onCompleted();
    }

    @Override
    public void onError(Throwable e) {
        this.mListener.onCompleted();
        this.mListener.onError(e.getMessage());
    }
}
